﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ModelLayer
{
    public class Show
    {
        private int id;
        private Movie movie;
        private Room room;
        private DateTime dateTime;
        private decimal showPrice;

        public Show(Movie movie, Room room, DateTime dateTime)
        {
            this.movie = movie;
            this.room = room;
            this.dateTime = dateTime;
        }

        public Show(Movie movie, Room room, DateTime dateTime, decimal showPrice)
        {
            this.movie = movie;
            this.room = room;
            this.dateTime = dateTime;
            this.showPrice = showPrice;
        }

        public Show(int id, Movie movie, Room room, DateTime dateTime, decimal showPrice)
        {
            this.id = id;
            this.movie = movie;
            this.room = room;
            this.dateTime = dateTime;
            this.showPrice = showPrice;
        }

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        public Movie Movie
        {
            get { return movie; }
            set { movie = value; }
        }

        public decimal ShowPrice
        {
            get { return showPrice; }
            set { showPrice = value;  }
        }

        public Room Room
        {
            get { return room; }
            set { room = value; }
        }

        public DateTime DateTime
        {
            get { return dateTime; }
            set { dateTime = value; }
        }

        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }

            Show s = (Show) obj;
            

            return
                this.Id.Equals(s.Id) &&
                this.Movie.Equals(s.Movie) &&
                this.Room.Equals(s.Room) &&
                this.DateTime.Equals(s.DateTime);
        }

        public override string ToString()
        {
            return this.dateTime.ToShortTimeString() + " - " + this.movie.ToString();
        }
    }
}
